export default function App() {
  return <>
      <Father></Father>
      {/* <Child></Child> */}
    </>

}

interface ChildProps {
  gift: string;
}
function Child(props: ChildProps) {
    //如果是类函数，用写好构造函数
    // constructor(props: ChildProps) {
    //   super(props);
    //   this.props = props;
    // }
  return (
    <>
      <div className="Child">这是儿子-----爸爸给了{props.gift}</div>
    </>
  );
}

function Father() {
  return (
    <>
      <div className="Father">这是父亲</div>
      <hr />
      <Child gift={"礼物1"}></Child>
    </>
  );
}
